﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;

using NUnit.Framework;

using Yawf.Test;

namespace Yawf.Core {
	[TestFixture] 
	public class InitializerTest {

		[Test]
		public void TestGetObject() {
			Initializer initializer = Initializer.Instance;
			DummyClass dummy;

			dummy = (DummyClass)initializer.GetObject("dummy");
			Assert.IsNotNull(dummy,"Dummy is null");
			Assert.AreEqual(dummy.Value1,100000000,"Dummy.Value1 != 100000000");
			Assert.AreEqual(dummy.Value2,10,"Dummy.Value2 != 10");
			Assert.AreEqual(dummy.Value3.ToString("##.00",new CultureInfo("en-US")),"99.99","Dummy.Value3 != 99.99");
			Assert.AreEqual(dummy.Value4,"No es un valor numerico","Dummy.Value4 != 'No es un valor numerico'");

			Assert.IsNotNull(dummy.Value5,"Dummy.Value5 is null");
			dummy = dummy.Value5;
			Assert.AreEqual(dummy.Value1,200000000,"Dummy.Value1 != 200000000");
			Assert.AreEqual(dummy.Value2,20,"Dummy.Value2 != 20");
			Assert.AreEqual(dummy.Value3.ToString("##.00",new CultureInfo("en-US")),"299.99","Dummy.Value3 != 99.99");
			Assert.AreEqual(dummy.Value4,"Si es un valor numerico","Dummy.Value4 != 'Si es un valor numerico'");
		}
	
	}
}
